package com.ssy.lingxi.product.api.enums;

import java.util.Arrays;

/**
 * 单据类型枚举
 *
 * @author wrc
 * @date 2020/10/14
 */
public enum InvoicesTypeEnum {
    /**
     * 采购入库单
     */
    PLATFORM_MEMBER_VERIFY(1L,"S001", "采购入库单"),
    /**
     * 销售发货单
     */
    SALES_INVOICE(2L,"S002", "销售发货单"),
    /**
     * 加工入库单
     */
    PROCESSING_STOCK_IN(3L,"S003", "加工入库单"),
    /**
     * 加工发货单
     */
    PROCESSING_INVOICE(4L,"S004", "加工发货单"),
    /**
     *
     * 退货发货单
     */
    RETURN_INVOICE(5L,"S005", "退货发货单"),
    /**
     * 退货入库单
     */
    RETURN_STOCK_IN(6L,"S006", "退货入库单"),
    /**
     *
     *换货发货单
     */
    EXCHANGE_INVOICE(7L,"S007", "换货发货单"),
    /**
     * 换货入库单
     */
    STOCK_REPLACEMENT(8L,"S008", "换货入库单"),
    /**
     * Hcx采购入库单
     */
    HCX_PURCHASE_STOCK_IN(9L,"H001", "Hcx采购入库单"),
    /**
     * Hcx销售发货单
     */
    HCX_SALES_INVOICE(10L,"H002", "Hcx销售发货单"),

    /**
     * 售后换货退货发货单
     */
    ADD_RETURN_SHIPMENT(11L,"H003", "换货退货发货单"),
    /**
     * 售后换货退货入库单
     */
    ADD_A_GOODS_RETURN_WAREHOUSING_DOCUMENT(12L,"H004", "换货退货入库单");


    private Long id;
    private String code;
    private String name;

    InvoicesTypeEnum() {
    }
   public static String getInvoicesTypeName(Long id){
       InvoicesTypeEnum invoicesTypeEnum = Arrays.stream(InvoicesTypeEnum.values()).filter(v -> id.equals(v.getId())).findFirst().orElse(null);
        return (null==invoicesTypeEnum)?null:invoicesTypeEnum.name;
    }
    InvoicesTypeEnum(Long id,String code, String name) {
        this.id=id;
        this.code = code;
        this.name = name;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
